//
//  JYOAuthAccount.m
//  FpdCarInCube
//
//  Created by WXC on 2017/4/11.
//  Copyright © 2017年 jiaoyin. All rights reserved.
//

#import "JYOAuthAccount.h"

@implementation JYOAuthAccount

// 单例
HMSingletonM(JYOAuthAccount)

+ (instancetype)accountWithDict:(NSDictionary *)dict
{
    JYOAuthAccount *account = [[self alloc] init];
    account.Token = dict[@"Token"];
    account.Expires = dict[@"CurUserInfo"][@"Expires"];
    NSNumber *ID = dict[@"CurUserInfo"][@"UserId"];
    account.UserId = ID.integerValue;
    account.Data = dict;
    return account;
}

- (UIInterfaceOrientationMask)interfaceOrientationMask
{
    if (self.flag == 1) {
        return UIInterfaceOrientationMaskLandscape;
    }else {
        return UIInterfaceOrientationMaskPortrait;
    }
}

@end
